package com.edu.demo.mapper;

import com.edu.demo.entity.SysMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jixuewei
 * @since 2023-01-12
 */
@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    @Select("select m.* from sys_menu m,role_menu  rm where m.menu_id= rm.m_id and rm.r_id = #{rId} ")
    Set<SysMenu> selectMenusByRole(@Param("rId") Integer role_id);


}
